<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="profile" href="https://gmpg.org/xfn/11">
	<link href="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/favicon/favicon.png" rel="icon">
  <title>Linux环境变量配置方法详解 - Lixypro博客</title>

	<meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1">

	<!-- This site is optimized with the Yoast SEO plugin v16.1.1 - https://yoast.com/wordpress/plugins/seo/ -->
	<title>Linux环境变量配置方法详解 - Lixypro博客</title>
	<meta name="description" content="Lixypro博客 后端运维 Linux环境变量配置方法详解 在自定义安装软件的时候，经常需要配置环境变量，下面列举出各种对环境变量的配置方法。">
	<link rel="canonical" href="https://blog.lixypro.com/houduanyunwei/detailed-explanation-of-linux-environment-variable-configuration-method.html">
	<meta property="og:locale" content="zh_CN">
	<meta property="og:type" content="article">
	<meta property="og:title" content="Linux环境变量配置方法详解 - Lixypro博客">
	<meta property="og:description" content="Lixypro博客 后端运维 Linux环境变量配置方法详解 在自定义安装软件的时候，经常需要配置环境变量，下面列举出各种对环境变量的配置方法。">
	<meta property="og:url" content="https://blog.lixypro.com/houduanyunwei/detailed-explanation-of-linux-environment-variable-configuration-method.html">
	<meta property="og:site_name" content="Lixypro博客">
	<meta property="article:published_time" content="2021-04-10T14:31:51+00:00">
	<meta name="twitter:card" content="summary_large_image">
	<meta name="twitter:label1" content="作者">
	<meta name="twitter:data1" content="administrator">
	<meta name="twitter:label2" content="预计阅读时间">
	<meta name="twitter:data2" content="3分">
	<script type="application/ld+json" class="yoast-schema-graph">{"@context":"https://schema.org","@graph":[{"@type":"WebSite","@id":"https://blog.lixypro.com/#website","url":"https://blog.lixypro.com/","name":"Lixypro博客","description":"技术分享|网页前端|后端运维|网络安全|日常记事","potentialAction":[{"@type":"SearchAction","target":"https://blog.lixypro.com/?s={search_term_string}","query-input":"required name=search_term_string"}],"inLanguage":"zh-CN"},{"@type":"WebPage","@id":"https://blog.lixypro.com/houduanyunwei/detailed-explanation-of-linux-environment-variable-configuration-method.html#webpage","url":"https://blog.lixypro.com/houduanyunwei/detailed-explanation-of-linux-environment-variable-configuration-method.html","name":"Linux环境变量配置方法详解 - Lixypro博客","isPartOf":{"@id":"https://blog.lixypro.com/#website"},"datePublished":"2021-04-10T14:31:51+00:00","dateModified":"2021-04-10T14:31:51+00:00","author":{"@id":"https://blog.lixypro.com/#/schema/person/504c3e2a3d8a31f292936e7a2241373b"},"description":"Lixypro博客 后端运维 Linux环境变量配置方法详解 在自定义安装软件的时候，经常需要配置环境变量，下面列举出各种对环境变量的配置方法。","breadcrumb":{"@id":"https://blog.lixypro.com/houduanyunwei/detailed-explanation-of-linux-environment-variable-configuration-method.html#breadcrumb"},"inLanguage":"zh-CN","potentialAction":[{"@type":"ReadAction","target":["https://blog.lixypro.com/houduanyunwei/detailed-explanation-of-linux-environment-variable-configuration-method.html"]}]},{"@type":"BreadcrumbList","@id":"https://blog.lixypro.com/houduanyunwei/detailed-explanation-of-linux-environment-variable-configuration-method.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"item":{"@type":"WebPage","@id":"https://blog.lixypro.com/","url":"https://blog.lixypro.com/","name":"首页"}},{"@type":"ListItem","position":2,"item":{"@type":"WebPage","@id":"https://blog.lixypro.com/houduanyunwei/detailed-explanation-of-linux-environment-variable-configuration-method.html","url":"https://blog.lixypro.com/houduanyunwei/detailed-explanation-of-linux-environment-variable-configuration-method.html","name":"Linux环境变量配置方法详解"}}]},{"@type":"Person","@id":"https://blog.lixypro.com/#/schema/person/504c3e2a3d8a31f292936e7a2241373b","name":"administrator","image":{"@type":"ImageObject","@id":"https://blog.lixypro.com/#personlogo","inLanguage":"zh-CN","url":"https://secure.gravatar.com/avatar/957d4bcaf62a121072d884ad505a9b2a?s=96&d=mm&r=g","contentUrl":"https://secure.gravatar.com/avatar/957d4bcaf62a121072d884ad505a9b2a?s=96&d=mm&r=g","caption":"administrator"},"sameAs":["https://blog.lixypro.com"]}]}</script>
	<!-- / Yoast SEO plugin. -->


<link rel="stylesheet" id="toc-screen-css" href="https://blog.lixypro.com/wp-content/plugins/table-of-contents-plus/screen.min.css?ver=2002" type="text/css" media="all">
<link rel="stylesheet" id="Katex-css" href="https://cdn.jsdelivr.net/wp/wp-editormd/tags/10.2.1/assets/KaTeX/katex.min.css?ver=10.2.1" type="text/css" media="all">
<link rel="stylesheet" id="prism-theme-style-css" href="https://cdn.jsdelivr.net/wp/wp-editormd/tags/10.2.1/assets/Prism.js/themes/prism-okaidia.css?ver=1.15.0" type="text/css" media="all">
<link rel="stylesheet" id="prism-plugin-toolbar-css" href="https://cdn.jsdelivr.net/wp/wp-editormd/tags/10.2.1/assets/Prism.js/plugins/toolbar/prism-toolbar.css?ver=1.15.0" type="text/css" media="all">
<link rel="stylesheet" id="prism-plugin-line-numbers-css" href="https://cdn.jsdelivr.net/wp/wp-editormd/tags/10.2.1/assets/Prism.js/plugins/line-numbers/prism-line-numbers.css?ver=1.15.0" type="text/css" media="all">
<link rel="stylesheet" id="external-css" href="https://blog.lixypro.com/wp-content/themes/ripro/assets/css/external.css?ver=7.1.0" type="text/css" media="all">
<link rel="stylesheet" id="sweetalert2-css" href="https://blog.lixypro.com/wp-content/themes/ripro/assets/css/sweetalert2.min.css?ver=7.1.0" type="text/css" media="all">
<link rel="stylesheet" id="app-css" href="https://blog.lixypro.com/wp-content/themes/ripro/assets/css/app.css?ver=7.1.0" type="text/css" media="all">
<link rel="stylesheet" id="diy-css" href="https://blog.lixypro.com/wp-content/themes/ripro/assets/css/diy.css?ver=7.1.0" type="text/css" media="all">
<link rel="stylesheet" id="fancybox-css" href="https://blog.lixypro.com/wp-content/themes/ripro/assets/css/jquery.fancybox.min.css?ver=7.1.0" type="text/css" media="all">
<script type="text/javascript" src="https://blog.lixypro.com/wp-content/themes/ripro/assets/js/jquery-2.2.4.min.js?ver=2.2.4" id="jquery-js"></script>
<script type="text/javascript" src="https://blog.lixypro.com/wp-content/themes/ripro/assets/js/plugins/sweetalert2.min.js?ver=7.1.0" id="sweetalert2-js"></script>
		<script>
			document.documentElement.className = document.documentElement.className.replace( 'no-js', 'js' );
		</script>
				<style>.no-js img.lazyload { display: none; }
			figure.wp-block-image img.lazyloading { min-width: 150px; }
							.lazyload, .lazyloading { opacity: 0; }
				.lazyloaded {
					opacity: 1;
					transition: opacity 400ms;
					transition-delay: 0ms;
				}</style>
			<!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
    <!--[if lt IE 9]>
      <script src="https://blog.lixypro.com/wp-content/themes/ripro/assets/js/html5shiv.js"></script>
      <script src="https://blog.lixypro.com/wp-content/themes/ripro/assets/js/respond.min.js"></script>
    <![endif]-->
          <script> $(document).ready(function() { NProgress.start(); $(window).load(function() { NProgress.done(); }); });</script>
    </head>

<body class="post-template-default single single-post postid-53 single-format-standard  max_width navbar-sticky navbar-full navbar-slide no-search sidebar-none pagination-numeric no-off-canvas">

<div class="site">
    
<header class="site-header">
      <div class="navbar">
      <div class="logo-wrapper">
              <a href="https://blog.lixypro.com/">
          <img data-dark="" alt="Lixypro博客" data-src="https://blog.lixypro.com/wp-content/uploads/2021/04/1618068529-96d6f2e7e1f705a.png" class="logo regular tap-logo lazyload" src=""><noscript><img class="logo regular tap-logo" src="https://blog.lixypro.com/wp-content/uploads/2021/04/1618068529-96d6f2e7e1f705a.png" data-dark="" alt="Lixypro博客"></noscript>
        </a>
            </div>
      <div class="sep"></div>
      
      <nav class="main-menu hidden-xs hidden-sm hidden-md">
        <ul id="menu-menu-1" class="nav-list u-plain-list">
<li id="menu-item-12" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-home menu-item-12"><a href="https://blog.lixypro.com/">本站首页</a></li>
<li id="menu-item-15" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-15"><a href="https://blog.lixypro.com/tags">标签集合</a></li>
<li id="menu-item-18" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-18"><a href="https://blog.lixypro.com/qianduansixiang">前端思想</a></li>
<li id="menu-item-19" class="menu-item menu-item-type-taxonomy menu-item-object-category current-post-ancestor current-menu-parent current-post-parent menu-item-19"><a href="https://blog.lixypro.com/houduanyunwei">后端运维</a></li>
<li id="menu-item-20" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-20"><a href="https://blog.lixypro.com/zaixianfuwu">在线服务</a></li>
<li id="menu-item-21" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-21"><a href="https://blog.lixypro.com/diannaojichu">电脑基础</a></li>
<li id="menu-item-22" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-22"><a href="https://blog.lixypro.com/kejizixun">科技资讯</a></li>
<li id="menu-item-23" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-23"><a href="https://blog.lixypro.com/wangluoanquan">网络安全</a></li>
</ul>      </nav>
      
      <div class="main-search">
        <form method="get" class="search-form inline" action="https://blog.lixypro.com/">
  <input type="search" class="search-field inline-field" placeholder="输入关键词，回车..." autocomplete="off" value="" name="s" required="required">
  <button type="submit" class="search-submit"><i class="mdi mdi-magnify"></i></button>
</form>        <div class="search-close navbar-button"><i class="mdi mdi-close"></i></div>
      </div>

      <div class="actions">
                <!-- user end -->
        <div class="search-open navbar-button"><i class="mdi mdi-magnify"></i></div>
                <div class="burger"></div>
      </div>
    </div>
  </header>

<div class="header-gap"></div>    
    <div class="site-content">
    

<div class="container">
	<div class="breadcrumbs">
	当前位置：<a href="https://blog.lixypro.com/">Lixypro博客</a> <small>></small> <a href="https://blog.lixypro.com/houduanyunwei">后端运维</a> <small>></small> Linux环境变量配置方法详解	</div>
	<div class="row">
		<div class="col-lg-12">
			<div class="content-area">
				<main class="site-main">
					<article id="post-53" class="article-content">
    <div class="container">
  
<div class="cao_entry_header">

  <header class="entry-header">    
    <h1 class="entry-title">Linux环境变量配置方法详解</h1>  </header>
</div>
</div>  <div class="container">
    <div class="entry-wrapper">
            <div class="entry-content u-text-format u-clearfix">
        <p>在自定义安装软件的时候，经常需要配置环境变量，下面列举出各种对环境变量的配置方法。</p>
<p>下面所有例子的环境说明如下：</p>
<ul>
<li>系统：Ubuntu 14.0</li>
<li>用户名：uusama</li>
<li>需要配置MySQL环境变量路径：/home/uusama/mysql/bin</li>
</ul>
<h2>环境变量：定义每个用户的操作环境</h2>
<ol>
<li>Source命令：修改配置文件后，必须注销重新登录才能生效，使用source命令后，立即生效环境变量配置文件；</li>
</ol>
<p>命令如下：source 配置文件  或者  . 配置文件</p>
<ol start="2">
<li>
<strong>环境变量配置文件简介：</strong>环境变量配置文件中主要是定义对系统操作环境生效的系统默认环境变量，如PATH等；PATH、HISTSIZE、PS1、HOSTNAME等环境变量写入对应的环境变量配置文件；</li>
</ol>
<p><strong>3.       常见的环境变量：</strong></p>
<ol>
<li>
<pre><code>/etc/profile
</code></pre>
</li>
<li>
<pre><code>/etc/profile.d/*.sh
</code></pre>
</li>
<li>
<pre><code>~/.bash_profile
</code></pre>
</li>
<li>
<pre><code>~/.bashrc
</code></pre>
</li>
<li>
<pre><code>/etc/bashrc
</code></pre>
</li>
</ol>
<p>注：<strong>放在家目录（3,4）下的环境变量配置文件，只会对当前用户起作用；在/etc下的环境变量所有的用户都起作用；</strong></p>
<h3>Linux读取环境变量</h3>
<p>读取环境变量的方法：</p>
<ul>
<li>
<code>export</code>命令显示当前系统定义的所有环境变量</li>
<li>
<code>echo $PATH</code>命令输出当前的<code>PATH</code>环境变量的值</li>
</ul>
<p>这两个命令执行的效果如下</p>
<pre><code class="language-shell line-numbers">uusama@ubuntu:~<span class="katex math inline">export
declare -x HOME="/home/uusama"
declare -x LANG="en_US.UTF-8"
declare -x LANGUAGE="en_US:"
declare -x LESSCLOSE="/usr/bin/lesspipe %s %s"
declare -x LESSOPEN="| /usr/bin/lesspipe %s"
declare -x LOGNAME="uusama"
declare -x MAIL="/var/mail/uusama"
declare -x PATH="/home/uusama/bin:/home/uusama/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
declare -x SSH_TTY="/dev/pts/0"
declare -x TERM="xterm"
declare -x USER="uusama"

uusama@ubuntu:~</span> echo $PATH
/home/uusama/bin:/home/uusama/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
</code></pre>
<p>其中<code>PATH</code>变量定义了运行命令的查找路径，以冒号<code>:</code>分割不同的路径，使用<code>export</code>定义的时候可加双引号也可不加。</p>
<h3>Linux环境变量配置方法一：<code>export PATH</code>
</h3>
<p>使用<code>export</code>命令直接修改<code>PATH</code>的值，配置MySQL进入环境变量的方法:</p>
<pre><code class="language-shell line-numbers">export PATH=/home/uusama/mysql/bin:<span class="katex math inline">PATH

# 或者把PATH放在前面
export PATH=</span>PATH:/home/uusama/mysql/bin
</code></pre>
<p>注意事项：</p>
<ul>
<li>生效时间：立即生效</li>
<li>生效期限：当前终端有效，窗口关闭后无效</li>
<li>生效范围：仅对当前用户有效</li>
<li>配置的环境变量中不要忘了加上原来的配置，即<code>$PATH</code>部分，避免覆盖原来配置</li>
</ul>
<h3>Linux环境变量配置方法二：<code>vim ~/.bashrc</code>
</h3>
<p>通过修改用户目录下的<code>~/.bashrc</code>文件进行配置：</p>
<pre><code class="language-shell line-numbers">vim ~/.bashrc

# 在最后一行加上
export PATH=$PATH:/home/uusama/mysql/bin
</code></pre>
<p>注意事项：</p>
<ul>
<li>生效时间：使用相同的用户打开新的终端时生效，或者手动<code>source ~/.bashrc</code>生效</li>
<li>生效期限：永久有效</li>
<li>生效范围：仅对当前用户有效</li>
<li>如果有后续的环境变量加载文件覆盖了<code>PATH</code>定义，则可能不生效</li>
</ul>
<h3>Linux环境变量配置方法三：<code>vim ~/.bash_profile</code>
</h3>
<p>和修改<code>~/.bashrc</code>文件类似，也是要在文件最后加上新的路径即可：</p>
<pre><code class="language-shell line-numbers">vim ~/.bash_profile

# 在最后一行加上
export PATH=$PATH:/home/uusama/mysql/bin
</code></pre>
<p>注意事项：</p>
<ul>
<li>生效时间：使用相同的用户打开新的终端时生效，或者手动<code>source ~/.bash_profile</code>生效</li>
<li>生效期限：永久有效</li>
<li>生效范围：仅对当前用户有效</li>
<li>如果没有<code>~/.bash_profile</code>文件，则可以编辑<code>~/.profile</code>文件或者新建一个</li>
</ul>
<h3>Linux环境变量配置方法四：<code>vim /etc/bashrc</code>
</h3>
<p>该方法是修改系统配置，需要管理员权限（如root）或者对该文件的写入权限：</p>
<pre><code class="language-shell line-numbers"># 如果/etc/bashrc文件不可编辑，需要修改为可编辑
chmod -v u+w /etc/bashrc

vim /etc/bashrc

# 在最后一行加上
export PATH=$PATH:/home/uusama/mysql/bin
</code></pre>
<p>注意事项：</p>
<ul>
<li>生效时间：新开终端生效，或者手动<code>source /etc/bashrc</code>生效</li>
<li>生效期限：永久有效</li>
<li>生效范围：对所有用户有效</li>
</ul>
<h3>Linux环境变量配置方法五：<code>vim /etc/profile</code>
</h3>
<p>该方法修改系统配置，需要管理员权限或者对该文件的写入权限，和<code>vim /etc/bashrc</code>类似：</p>
<pre><code class="language-shell line-numbers"># 如果/etc/profile文件不可编辑，需要修改为可编辑
chmod -v u+w /etc/profile

vim /etc/profile

# 在最后一行加上
export PATH=$PATH:/home/uusama/mysql/bin
</code></pre>
<p>注意事项：</p>
<ul>
<li>生效时间：新开终端生效，或者手动<code>source /etc/profile</code>生效</li>
<li>生效期限：永久有效</li>
<li>生效范围：对所有用户有效</li>
</ul>
<h3>Linux环境变量配置方法六：<code>vim /etc/environment</code>
</h3>
<p>该方法是修改系统环境配置文件，需要管理员权限或者对该文件的写入权限：</p>
<pre><code class="language-shell line-numbers"># 如果/etc/bashrc文件不可编辑，需要修改为可编辑
chmod -v u+w /etc/environment

vim /etc/profile

# 在最后一行加上
export PATH=$PATH:/home/uusama/mysql/bin
</code></pre>
<p>注意事项：</p>
<ul>
<li>生效时间：新开终端生效，或者手动<code>source /etc/environment</code>生效</li>
<li>生效期限：永久有效</li>
<li>生效范围：对所有用户有效</li>
</ul>
<h3>一、java环境变量</h3>
<p><strong>1、解压tar包到指定目录：</strong></p>
<pre><code class="language-ruby line-numbers">tar -zxvf jdk-8u201-linux-x64.tar.gz -C /opt/module/

</code></pre>
<p><strong>2、编辑系统变量：</strong></p>
<pre><code class="language-bash line-numbers">vim /etc/profile

#JAVA_HOME
export JAVA_HOME=/opt/module/jdk1.8.0_201
export PATH=<span class="katex math inline">PATH:</span>JAVA_HOME/bin

</code></pre>
<p><strong>3、使环境变量生效：</strong></p>
<pre><code class="language-bash line-numbers">source /etc/profile

</code></pre>
<h3>二、hadoop环境变量</h3>
<p><strong>1、解压tar包到指定目录：</strong></p>
<pre><code class="language-ruby line-numbers">tar -zxvf hadoop-3.2.0.tar.gz -C /opt/module/

</code></pre>
<p><strong>2、编辑系统变量：</strong></p>
<pre><code class="language-bash line-numbers">vim /etc/profile

#HADOOP_HOME
export HADOOP_HOME=/opt/module/hadoop-3.2.0
export PATH=<span class="katex math inline">PATH:</span>HADOOP_HOME/bin
export PATH=<span class="katex math inline">PATH:</span>HADOOP_HOME/sbin

</code></pre>
<p><strong>3、使环境变量生效：</strong></p>
<pre><code class="language-bash line-numbers">source /etc/profile

</code></pre>
<p><strong>4、修改hadoop配置文件：</strong></p>
<pre><code class="language-cpp line-numbers">vim /opt/module/hadoop-3.2.0/etc/hadoop/hadoop-env.sh

export JAVA_HOME=/opt/module/jdk1.8.0_201
</code></pre>
<h2>Linux环境变量加载原理解析</h2>
<p>上面列出了环境变量的各种配置方法，那么Linux是如何加载这些配置的呢？是以什么样的顺序加载的呢？</p>
<p>特定的加载顺序会导致相同名称的环境变量定义被覆盖或者不生效。</p>
<h3>环境变量的分类</h3>
<p>环境变量可以简单的分成用户自定义的环境变量以及系统级别的环境变量。</p>
<ul>
<li>用户级别环境变量定义文件：<code>~/.bashrc</code>、<code>~/.profile</code>（部分系统为：<code>~/.bash_profile</code>）</li>
<li>系统级别环境变量定义文件：<code>/etc/bashrc</code>、<code>/etc/profile</code>(部分系统为：<code>/etc/bash_profile</code>）、<code>/etc/environment</code>
</li>
</ul>
<p>另外在用户环境变量中，系统会首先读取<code>~/.bash_profile</code>文件，如果没有该文件则读取<code>~/.bash_login</code>，如果也没有该文件，则读取<code>~/.profile</code>，根据这些文件中内容再去读取<code>~/.bashrc</code>。</p>
<h3>测试Linux环境变量加载顺序的方法</h3>
<p>为了测试各个不同文件的环境变量加载顺序，我们在每个环境变量定义文件中的第一行都定义相同的环境变量<code>UU_ORDER</code>，该变量的值为本身的值连接上当前文件名称。</p>
<p>需要修改的文件如下：</p>
<ul>
<li>/etc/environment</li>
<li>/etc/profile</li>
<li>/etc/profile.d/test.sh，新建文件，没有文件夹可略过</li>
<li>/etc/bashrc，或者/etc/bash.bashrc</li>
<li>~/.bash_profile，或者~/.profile</li>
<li>~/.bashrc</li>
</ul>
<p>在每个文件中的第一行都加上下面这句代码，并相应的把冒号后的内容修改为当前文件的绝对文件名。</p>
<p><code>export UU_ORDER="$UU_ORDER:~/.bash_profile"</code></p>
<p>修改完之后保存，新开一个窗口，然后<code>echo $UU_ORDER</code>观察变量的值：</p>
<pre><code class="language-shell line-numbers">uusama@ubuntu:~<span class="katex math inline">echo</span>UU_ORDER
$UU_ORDER:/etc/environment:/etc/profile:/etc/bash.bashrc:/etc/profile.d/test.sh:~/.profile:~/.bashrc
</code></pre>
<p>可以推测出Linux加载环境变量的顺序如下：</p>
<ol>
<li>/etc/environment</li>
<li>/etc/profile</li>
<li>/etc/bash.bashrc</li>
<li>/etc/profile.d/test.sh</li>
<li>~/.profile</li>
<li>~/.bashrc</li>
</ol>
<h3>Linux环境变量文件加载详解</h3>
<p>由上面的测试可容易得出Linux加载环境变量的顺序如下，：</p>
<p>系统环境变量 -&#62; 用户自定义环境变量<br>
/etc/environment -> /etc/profile -> ~/.profile</p>
<p>打开<code>/etc/profile</code>文件你会发现，该文件的代码中会加载<code>/etc/bash.bashrc</code>文件，然后检查<code>/etc/profile.d/</code>目录下的<code>.sh</code>文件并加载。</p>
<pre><code class="language-shell line-numbers"># /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

if [ "<span class="katex math inline">PS1" ]; then
  if [ "</span>BASH" ] &amp;&amp; [ "<span class="katex math inline">BASH" != "/bin/sh" ]; then
    # The file bash.bashrc already sets the default PS1.
    # PS1='\h:\w\$ '
    if [ -f /etc/bash.bashrc ]; then
      . /etc/bash.bashrc
    fi
  else
    if [ "`id -u`" -eq 0 ]; then
      PS1='# '
    else
      PS1='</span> '
    fi
  fi
fi

if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r <span class="katex math inline">i ]; then
      .</span>i
    fi
  done
  unset i
fi
</code></pre>
<p>其次再打开<code>~/.profile</code>文件，会发现该文件中加载了<code>~/.bashrc</code>文件。</p>
<pre><code class="language-shell line-numbers"># if running bash
if [ -n "<span class="katex math inline">BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "</span>HOME/.bashrc" ]; then
    . "<span class="katex math inline">HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin directories
PATH="</span>HOME/bin:<span class="katex math inline">HOME/.local/bin:</span>PATH"
</code></pre>
<p>从<code>~/.profile</code>文件中代码不难发现，<code>/.profile</code>文件<strong>只在用户登录的时候读取一次</strong>，而<code>/.bashrc</code>会在每次运行<code>Shell</code>脚本的时候读取一次。</p>
<h3>一些小技巧</h3>
<p>可以自定义一个环境变量文件，比如在某个项目下定义<code>uusama.profile</code>，在这个文件中使用<code>export</code>定义一系列变量，然后在<code>~/.profile</code>文件后面加上：<code>sourc uusama.profile</code>，这样你每次登陆都可以在Shell脚本中使用自己定义的一系列变量。</p>
<p>也可以使用<code>alias</code>命令定义一些命令的别名，比如<code>alias rm="rm -i"</code>（双引号必须），并把这个代码加入到<code>~/.profile</code>中，这样你每次使用<code>rm</code>命令的时候，都相当于使用<code>rm -i</code>命令，非常方便。</p>
      </div>
      <div id="pay-single-box"></div>
          <div class="entry-tags">
          <a href="https://blog.lixypro.com/tag/centos" rel="tag">
        Centos      </a>
      </div>
<div class="article-copyright">RIPRO主题是一个优秀的主题，极致后台体验，无插件，集成会员系统<br><a href="https://blog.lixypro.com/">Lixypro博客</a> &raquo; <a href="https://blog.lixypro.com/houduanyunwei/detailed-explanation-of-linux-environment-variable-configuration-method.html">Linux环境变量配置方法详解</a>
</div>

<div class="article-footer">
    <div class="author-box">
    <div class="author-image">
      <img alt="administrator" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/avatar/1.png" class="lazyload avatar avatar-140 photo " height="140" width="140">    </div>
    <div class="author-info">
      <h4 class="author-name">
        <a target="_blank" href="javascript:;">administrator</a>
        <span class="label label-default"><i class="fa fa-diamond"></i> 普通</span>      </h4>
    </div>
  </div>
      <div class="xshare">
      <span class="xshare-title">分享到：</span>
            <a etap="share" data-share="qq" class="share-qq"><i class="fa fa-qq"></i></a>
      <a etap="share" data-share="weibo" class="share-weibo"><i class="fa fa-weibo"></i></a>
              <a href="javascript:;" class="btn-bigger-cover share-weixin" data-nonce="57160feb54" data-id="53" data-action="create-bigger-image" id="bigger-cover"><i class="fa fa-paper-plane"></i></a>
        </div>
   
</div>    </div>
  </div>
</article>


  <div class="entry-navigation">
    <nav class="article-nav">
        <span class="article-nav-prev">上一篇<br><a href="https://blog.lixypro.com/houduanyunwei/use-firewalld-to-build-a-dynamic-firewall.html" rel="prev">Linux的FirewallD详细基础说明</a></span>
        <span class="article-nav-next">下一篇<br><a href="https://blog.lixypro.com/qianduansixiang/react-scaffolding-installation-demo-detailed-example-and-detailed-explanation.html" rel="next">React脚手架安装Demo详细示例，以及细节讲解</a></span>
    </nav>
    
  </div>

      <!-- # 标准网格模式... -->
      <div class="related-posts-grid">
        <h4 class="u-border-title">相关推荐</h4>
        <div class="row">
                     <div class="col-6 col-sm-3 col-md-3 mt-10 mb-10">
              <article class="post">
                  <div class="entry-media">
    <div class="placeholder" style="padding-bottom: 66.666666666667%;">
      <a target="_blank" href="https://blog.lixypro.com/houduanyunwei/use-firewalld-to-build-a-dynamic-firewall.html">
        <img class="lazyload" data-src="https://blog.lixypro.com/wp-content/themes/ripro/timthumb.php?src=https://blog.lixypro.com/wp-content/uploads/2021/04/1618139043-b6db0c73a979ae8.png&#038;h=200&#038;w=300&#038;zc=1&#038;a=c&#038;q=100&#038;s=1" src="" alt="Linux的FirewallD详细基础说明">  
      </a>
            <div class="cao-cover">
<img width="50" height="50px" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" class="lazyload" src=""><noscript>
<img width="50" height="50px" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" class="lazyload" src=""><noscript>
<img width="50" height="50px" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" class="lazyload" src=""><noscript>
<img width="50" height="50px" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" class="lazyload" src=""><noscript><img src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" width="50" height="50px"></noscript>
</noscript>
</noscript>
</noscript>
</div>
          </div>
      </div>
                  <div class="entry-wrapper">
                  
  <header class="entry-header">    
    <h4 class="entry-title"><a target="_blank" href="https://blog.lixypro.com/houduanyunwei/use-firewalld-to-build-a-dynamic-firewall.html" title="Linux的FirewallD详细基础说明" rel="bookmark">Linux的FirewallD详细基础说明</a></h4>  </header>                </div>
              </article>
            </div>
                      <div class="col-6 col-sm-3 col-md-3 mt-10 mb-10">
              <article class="post">
                  <div class="entry-media">
    <div class="placeholder" style="padding-bottom: 66.666666666667%;">
      <a target="_blank" href="https://blog.lixypro.com/houduanyunwei/dns-server-construction-and-configuration.html">
        <img class="lazyload" data-src="https://blog.lixypro.com/wp-content/themes/ripro/timthumb.php?src=https://blog.lixypro.com/wp-content/uploads/2021/04/1618139491-b3bf60b851ebaeb.png&#038;h=200&#038;w=300&#038;zc=1&#038;a=c&#038;q=100&#038;s=1" src="" alt="DNS服务器搭建与配置">  
      </a>
            <div class="cao-cover">
<img width="50" height="50px" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" class="lazyload" src=""><noscript>
<img width="50" height="50px" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" class="lazyload" src=""><noscript>
<img width="50" height="50px" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" class="lazyload" src=""><noscript>
<img width="50" height="50px" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" class="lazyload" src=""><noscript><img src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" width="50" height="50px"></noscript>
</noscript>
</noscript>
</noscript>
</div>
          </div>
      </div>
                  <div class="entry-wrapper">
                  
  <header class="entry-header">    
    <h4 class="entry-title"><a target="_blank" href="https://blog.lixypro.com/houduanyunwei/dns-server-construction-and-configuration.html" title="DNS服务器搭建与配置" rel="bookmark">DNS服务器搭建与配置</a></h4>  </header>                </div>
              </article>
            </div>
                      <div class="col-6 col-sm-3 col-md-3 mt-10 mb-10">
              <article class="post">
                  <div class="entry-media">
    <div class="placeholder" style="padding-bottom: 66.666666666667%;">
      <a target="_blank" href="https://blog.lixypro.com/houduanyunwei/linux-centos-install-nginx1-8-1-through-source-package.html">
        <img class="lazyload" data-src="https://blog.lixypro.com/wp-content/themes/ripro/timthumb.php?src=https://blog.lixypro.com/wp-content/uploads/2021/04/1618139383-73898d7f1ddbfbf.jpg&#038;h=200&#038;w=300&#038;zc=1&#038;a=c&#038;q=100&#038;s=1" src="" alt="Linux(centos)通过源码包方式安装nginx1.8.1">  
      </a>
            <div class="cao-cover">
<img width="50" height="50px" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" class="lazyload" src=""><noscript>
<img width="50" height="50px" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" class="lazyload" src=""><noscript>
<img width="50" height="50px" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" class="lazyload" src=""><noscript>
<img width="50" height="50px" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" class="lazyload" src=""><noscript><img src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" width="50" height="50px"></noscript>
</noscript>
</noscript>
</noscript>
</div>
          </div>
      </div>
                  <div class="entry-wrapper">
                  
  <header class="entry-header">    
    <h4 class="entry-title"><a target="_blank" href="https://blog.lixypro.com/houduanyunwei/linux-centos-install-nginx1-8-1-through-source-package.html" title="Linux(centos)通过源码包方式安装nginx1.8.1" rel="bookmark">Linux(centos)通过源码包方式安装nginx1.8.1</a></h4>  </header>                </div>
              </article>
            </div>
                      <div class="col-6 col-sm-3 col-md-3 mt-10 mb-10">
              <article class="post">
                  <div class="entry-media">
    <div class="placeholder" style="padding-bottom: 66.666666666667%;">
      <a target="_blank" href="https://blog.lixypro.com/houduanyunwei/centos7_install_fail2ban-0-9-4_and_linkage_iptables.html">
        <img class="lazyload" data-src="https://blog.lixypro.com/wp-content/themes/ripro/timthumb.php?src=https://blog.lixypro.com/wp-content/themes/ripro/assets/images/thumb/1.jpg&#038;h=200&#038;w=300&#038;zc=1&#038;a=c&#038;q=100&#038;s=1" src="" alt="CentOS7下fail2ban和iptables联动阻止恶意扫描和密码猜测等恶意攻击行为">  
      </a>
            <div class="cao-cover">
<img width="50" height="50px" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" class="lazyload" src=""><noscript>
<img width="50" height="50px" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" class="lazyload" src=""><noscript>
<img width="50" height="50px" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" class="lazyload" src=""><noscript>
<img width="50" height="50px" data-src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" class="lazyload" src=""><noscript><img src="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/svg/rings.svg" width="50" height="50px"></noscript>
</noscript>
</noscript>
</noscript>
</div>
          </div>
      </div>
                  <div class="entry-wrapper">
                  
  <header class="entry-header">    
    <h4 class="entry-title"><a target="_blank" href="https://blog.lixypro.com/houduanyunwei/centos7_install_fail2ban-0-9-4_and_linkage_iptables.html" title="CentOS7下fail2ban和iptables联动阻止恶意扫描和密码猜测等恶意攻击行为" rel="bookmark">CentOS7下fail2ban和iptables联动阻止恶意扫描和密码猜测等恶意攻击行为</a></h4>  </header>                </div>
              </article>
            </div>
                  </div>
      </div>
    
  

<div class="bottom-area">
    <div id="comments" class="comments-area">
        
        
        
        	<div id="respond" class="comment-respond">
		<h3 id="reply-title" class="comment-reply-title">发表评论 <small><a rel="nofollow" id="cancel-comment-reply-link" href="https://blog.lixypro.com/houduanyunwei/detailed-explanation-of-linux-environment-variable-configuration-method.html#respond" style="display:none;">取消回复</a></small>
</h3>
<form action="https://blog.lixypro.com/wp-comments-post.php" method="post" id="commentform" class="comment-form" novalidate>
<p class="comment-form-comment"><textarea id="comment" name="comment" rows="8" aria-required="true"></textarea></p>
<div class="row comment-author-inputs">
<div class="col-md-4 input"><p class="comment-form-author"><label for="author">昵称*</label><input id="author" name="author" type="text" value="" size="30" aria-required="true"></p></div>
<div class="col-md-4 input"><p class="comment-form-email"><label for="email">E-mail*</label><input id="email" name="email" type="text" value="" size="30" aria-required="true"></p></div>
<div class="col-md-4 input"><p class="comment-form-url"><label for="url">网站</label><input id="url" name="url" type="text" value="" size="30"></p></div>
</div>
<p class="comment-form-cookies-consent"><input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes"> <label for="wp-comment-cookies-consent">下次发表评论时，请在此浏览器中保存我的姓名、电子邮件和网站</label></p>
<p class="form-submit"><input name="submit" type="submit" id="submit" class="button" value="发表评论"> <input type="hidden" name="comment_post_ID" value="53" id="comment_post_ID">
<input type="hidden" name="comment_parent" id="comment_parent" value="0">
</p>
</form>	</div>
<!-- #respond -->
	    </div>
</div>				</main>
			</div>
		</div>
			</div>
</div>


</div>
<!-- end sitecoent --> 

	
	<div class="module parallax">
		<img class="jarallax-img lazyload" data-srcset="https://blog.lixypro.com/wp-content/themes/ripro/assets/images/background/bg-1.jpg" data-sizes="auto" src="" alt="">
		<div class="container">
			<h4 class="entry-title">
				提供最优质的资源集合			</h4>
							<a target="_blank" class="button" href="https://blog.lixypro.com/">立即查看</a>
										<a target="_blank" class="button transparent" href="https://blog.lixypro.com/">了解详情</a>
					</div>
	</div>
	
	<footer class="site-footer">
		<div class="container">
			
			<div class="footer-widget">
    <div class="row">
        <div class="col-xs-12 col-sm-6 col-md-3 widget--about">
            <div class="widget--content">
                <div class="footer--logo mb-20">
                    <img data-dark="https://blog.lixypro.com/wp-content/uploads/2021/04/1618068529-96d6f2e7e1f705a.png" alt="Lixypro博客" data-src="https://blog.lixypro.com/wp-content/uploads/2021/04/1618068529-96d6f2e7e1f705a.png" class="tap-logo lazyload" src=""><noscript><img class="tap-logo" src="https://blog.lixypro.com/wp-content/uploads/2021/04/1618068529-96d6f2e7e1f705a.png" data-dark="https://blog.lixypro.com/wp-content/uploads/2021/04/1618068529-96d6f2e7e1f705a.png" alt="Lixypro博客"></noscript>
                </div>
                <p class="mb-10">Lixypro博客网站,专注于各种技术类.</p>
            </div>
        </div>
        <!-- .col-md-2 end -->
        <div class="col-xs-12 col-sm-3 col-md-2 col-md-offset-1 widget--links">
            <div class="widget--title">
                <h5>本站导航</h5>
            </div>
            <div class="widget--content">
                <ul class="list-unstyled mb-0">
                                    </ul>
            </div>
        </div>
        <!-- .col-md-2 end -->
        <div class="col-xs-12 col-sm-3 col-md-2 widget--links">
            <div class="widget--title">
                <h5>友情链接</h5>
            </div>
            <div class="widget--content">
                <ul class="list-unstyled mb-0">
                    <li><a target="_blank" href="https://www.baidu.com/">百度一下</a></li>
<li><a target="_blank" href="https://www.zhihu.com/">知乎官网</a></li>                </ul>
            </div>
        </div>
        <!-- .col-md-2 end -->
        <div class="col-xs-12 col-sm-12 col-md-4 widget--newsletter">
            <div class="widget--title">
                <h5>快速搜索</h5>
            </div>
            <div class="widget--content">
                <form class="newsletter--form mb-30" action="https://blog.lixypro.com/" method="get">
                    <input type="text" class="form-control" name="s" placeholder="关键词">
                    <button type="submit"><i class="fa fa-arrow-right"></i></button>
                </form>
                <h6>本站由WordPress程序强力驱动</h6>
            </div>
        </div>

    </div>
</div>						  <div class="site-info">
			    © 2021 Lixypro博客 & WordPress Theme. All rights reserved			    			  </div>
					</div>
	</footer>
	
<div class="rollbar">
	
	<div class="rollbar-item" etap="to_full" title="全屏页面"><i class="fa fa-arrows-alt"></i></div>

	
		<div class="rollbar-item" etap="to_top" title="返回顶部"><i class="fa fa-angle-up"></i></div>
</div>

<div class="dimmer"></div>



<div class="off-canvas">
  <div class="canvas-close"><i class="mdi mdi-close"></i></div>
  <div class="logo-wrapper">
      <a href="https://blog.lixypro.com/">
      <img alt="Lixypro博客" data-src="https://blog.lixypro.com/wp-content/uploads/2021/04/1618068529-96d6f2e7e1f705a.png" class="logo regular lazyload" src=""><noscript><img class="logo regular" src="https://blog.lixypro.com/wp-content/uploads/2021/04/1618068529-96d6f2e7e1f705a.png" alt="Lixypro博客"></noscript>
    </a>
    </div>
  <div class="mobile-menu hidden-lg hidden-xl"></div>
  <aside class="widget-area">
      </aside>
</div>
<script>
    console.log("\n %c RiPro V7.1.0 %c https://blog.lixypro.com \n\n", "color: #fadfa3; background: #030307; padding:5px 0;", "background: #fadfa3; padding:5px 0;");
    console.log("SQL 请求数：69");
    console.log("页面生成耗时： 0.32298");
</script>



<script type="text/javascript" id="toc-front-js-extra">
/* <![CDATA[ */
var tocplus = {"visibility_show":"show","visibility_hide":"hide","width":"Auto"};
/* ]]> */
</script>
<script type="text/javascript" src="https://blog.lixypro.com/wp-content/plugins/table-of-contents-plus/front.min.js?ver=2002" id="toc-front-js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/wp/wp-editormd/tags/10.2.1/assets/jQuery/jquery.min.js?ver=10.2.1" id="jQuery-CDN-js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/wp/wp-editormd/tags/10.2.1/assets/KaTeX/katex.min.js?ver=10.2.1" id="Katex-js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/wp/wp-editormd/tags/10.2.1/assets/ClipBoard/clipboard.min.js?ver=2.0.1" id="copy-clipboard-js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/wp/wp-editormd/tags/10.2.1/assets/Prism.js/components/prism-core.min.js?ver=1.15.0" id="prism-core-js-js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/wp/wp-editormd/tags/10.2.1/assets/Prism.js/plugins/autoloader/prism-autoloader.min.js?ver=1.15.0" id="prism-plugin-autoloader-js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/wp/wp-editormd/tags/10.2.1/assets/Prism.js/plugins/toolbar/prism-toolbar.min.js?ver=1.15.0" id="prism-plugin-toolbar-js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/wp/wp-editormd/tags/10.2.1/assets/Prism.js/plugins/line-numbers/prism-line-numbers.min.js?ver=1.15.0" id="prism-plugin-line-numbers-js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/wp/wp-editormd/tags/10.2.1/assets/Prism.js/plugins/show-language/prism-show-language.min.js?ver=1.15.0" id="prism-plugin-show-language-js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/wp/wp-editormd/tags/10.2.1/assets/Prism.js/plugins/copy-to-clipboard/prism-copy-to-clipboard.min.js?ver=1.15.0" id="prism-plugin-copy-to-clipboard-js"></script>
<script type="text/javascript" id="Front_Style-js-extra">
/* <![CDATA[ */
var FrontStyle = {"openLinkInNewTab":"on"};
/* ]]> */
</script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/wp/wp-editormd/tags/10.2.1/assets/FrontStyle/frontstyle.min.js?ver=10.2.1" id="Front_Style-js"></script>
<script type="text/javascript" src="https://blog.lixypro.com/wp-content/plugins/wp-smushit/app/assets/js/smush-lazy-load.min.js?ver=3.8.4" id="smush-lazy-load-js"></script>
<script type="text/javascript" src="https://blog.lixypro.com/wp-content/themes/ripro/assets/js/plugins.js?ver=7.1.0" id="plugins-js"></script>
<script type="text/javascript" id="app-js-extra">
/* <![CDATA[ */
var caozhuti = {"site_name":"Lixypro博客","home_url":"https:\/\/blog.lixypro.com","ajaxurl":"https:\/\/blog.lixypro.com\/wp-admin\/admin-ajax.php","is_singular":"1","tencent_captcha":{"is":"","appid":""},"infinite_load":"加载更多","infinite_loading":"<i class=\"fa fa-spinner fa-spin\"><\/i> 加载中...","site_notice":{"is":"0","color":"rgb(33, 150, 243)","html":"<div class=\"notify-content\"><h3>Lixypro欢迎你!<\/h3><div>这是一条网站公告，可在后台开启或关闭，可自定义背景颜色，标题，内容，用户首次打开关闭后不再重复弹出，此处可使用html标签...<\/div><\/div>"},"pay_type_html":{"html":"<div class=\"pay-button-box\"><\/div><p style=\"font-size: 13px; padding: 0; margin: 0;\">免费或钻石免费资源仅限余额支付<\/p>","alipay":0,"weixinpay":0}};
/* ]]> */
</script>
<script type="text/javascript" src="https://blog.lixypro.com/wp-content/themes/ripro/assets/js/app.js?ver=7.1.0" id="app-js"></script>
<script type="text/javascript" src="https://blog.lixypro.com/wp-content/themes/ripro/assets/js/plugins/jquery.fancybox.min.js?ver=7.1.0" id="fancybox-js"></script>
<script type="text/javascript" src="https://blog.lixypro.com/wp-includes/js/comment-reply.min.js?ver=5.7" id="comment-reply-js"></script>
        <script type="text/javascript">
            (function ($) {
                $(document).ready(function () {
                    $(".katex.math.inline").each(function () {
                        var parent = $(this).parent()[0];
                        if (parent.localName !== "code") {
                            var texTxt = $(this).text();
                            var el = $(this).get(0);
                            try {
                                katex.render(texTxt, el);
                            } catch (err) {
                                $(this).html("<span class=\"err\">" + err);
                            }
                        } else {
                            $(this).parent().text($(this).parent().text());
                        }
                    });
                    $(".katex.math.multi-line").each(function () {
                        var texTxt = $(this).text();
                        var el = $(this).get(0);
                        try {
                            katex.render(texTxt, el, {displayMode: true})
                        } catch (err) {
                            $(this).html("<span class=\"err\">" + err)
                        }
                    });
                })
            })(jQuery);
        </script>
                <script type="text/javascript">
            Prism.plugins.autoloader.languages_path = "https://cdn.jsdelivr.net/wp/wp-editormd/tags/10.2.1/assets/Prism.js/components/";
        </script>
        
</div>
</body>
</html>